const express = require('express');
const db = require('../uilit/mysql');

const router=express.Router();

// 根据前端传递的id，找到个人头像路径
router.post('/selectimg',(req,res)=>{
    const sqlimg=`select s_img from seeker where s_id=${req.body.id}`;
    db.query(sqlimg,(err,data)=>{
        if(err){
            console.log(err);
        }else{
            console.log(data[0])
            res.send({img:data[0].s_img});
        }
    })
});

// 获取行业表数据，并将数据传给前端
router.post('/selectInd',(req,res)=>{
    const sqlind=`select * from industry_category`;
    db.query(sqlind,(err,data)=>{
        if(err){
            console.log(err);
        }else{
            res.send({industry:data});
        }
    })
});

// 获取招聘信息表数据，并将数据传给前端
// router.post('/selectjob',(req,res)=>{
//     const sqljob=`select * from job join company on job.c_id=company.c_id `

// });
module.exports=router;